//
//  CZSearchBar.m
//  OCKSFWeibo
//
//  Created by 盛 发 况 on 16/4/20.
//  Copyright © 2016年 盛 发 况. All rights reserved.
//

#import "CZSearchBar.h"

@implementation CZSearchBar

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        
        self.font = [UIFont systemFontOfSize:13];
        self.background = [UIImage imageWithStretchableName:@"searchbar_textfield_background"];
        
        // 设置左边的view
        UIImageView *imageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"searchbar_textfield_search_icon"]];
        imageV.width = 30;
        imageV.contentMode = UIViewContentModeCenter;
        self.leftView = imageV;
        
        // 一定要设置，想要显示搜索框左边的视图，一定要设置左边视图的模式
        self.leftViewMode = UITextFieldViewModeAlways;
    }
    return self;
}

@end




